import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/pages/home/components/Home'
import Header from '@/pages/home/components/Header'
import City from '@/pages/city/City'
import Detail from '@/pages/detail/components/Detail'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    },{
      path:'/header',
      name:'Header',
      component:Header
    },{
      path:'/city',
      name:'City',
      component:City
    },{
      path:'/detail/:id' ,    /*因为后面要跟id所以/detail/后面写:id 动态路由 */
      name:'Detail',
      component:Detail
    }
  ]
})
